<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActionController::TestProcess</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActionController::TestProcess</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/actionpack/lib/action_controller/test_process_rb.html">
                vendor/rails/actionpack/lib/action_controller/test_process.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000834">assigns</a>&nbsp;&nbsp;
      <a href="#M000839">build_request_uri</a>&nbsp;&nbsp;
      <a href="#M000837">cookies</a>&nbsp;&nbsp;
      <a href="#M000842">find_all_tag</a>&nbsp;&nbsp;
      <a href="#M000841">find_tag</a>&nbsp;&nbsp;
      <a href="#M000844">fixture_file_upload</a>&nbsp;&nbsp;
      <a href="#M000836">flash</a>&nbsp;&nbsp;
      <a href="#M000840">html_document</a>&nbsp;&nbsp;
      <a href="#M000830">included</a>&nbsp;&nbsp;
      <a href="#M000843">method_missing</a>&nbsp;&nbsp;
      <a href="#M000831">process</a>&nbsp;&nbsp;
      <a href="#M000838">redirect_to_url</a>&nbsp;&nbsp;
      <a href="#M000835">session</a>&nbsp;&nbsp;
      <a href="#M000845">with_routing</a>&nbsp;&nbsp;
      <a href="#M000833">xhr</a>&nbsp;&nbsp;
      <a href="#M000832">xml_http_request</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000830" class="method-detail">
        <a name="M000830"></a>

        <div class="method-heading">
          <a href="#M000830" class="method-signature">
          <span class="method-name">included</span><span class="method-args">(base)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000830-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000830-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 370</span>
370:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>)
371:       <span class="ruby-comment cmt"># execute the request simulating a specific HTTP method and set/volley the response</span>
372:       <span class="ruby-comment cmt"># TODO: this should be un-DRY'ed for the sake of API documentation.</span>
373:       <span class="ruby-node">%w( get post put delete head )</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span>
374:         <span class="ruby-identifier">base</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;def \#{method}(action, parameters = nil, session = nil, flash = nil)\n@request.env['REQUEST_METHOD'] = \&quot;\#{method.upcase}\&quot; if defined?(@request)\nprocess(action, parameters, session, flash)\nend\n&quot;</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>
375:       <span class="ruby-keyword kw">end</span>
376:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000834" class="method-detail">
        <a name="M000834"></a>

        <div class="method-heading">
          <a href="#M000834" class="method-signature">
          <span class="method-name">assigns</span><span class="method-args">(key = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000834-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000834-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 421</span>
421:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assigns</span>(<span class="ruby-identifier">key</span> = <span class="ruby-keyword kw">nil</span>)
422:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">nil?</span>
423:         <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">template</span>.<span class="ruby-identifier">assigns</span>
424:       <span class="ruby-keyword kw">else</span>
425:         <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">template</span>.<span class="ruby-identifier">assigns</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>]
426:       <span class="ruby-keyword kw">end</span>
427:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000839" class="method-detail">
        <a name="M000839"></a>

        <div class="method-heading">
          <a href="#M000839" class="method-signature">
          <span class="method-name">build_request_uri</span><span class="method-args">(action, parameters)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000839-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000839-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 445</span>
445:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_request_uri</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span>)
446:       <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'REQUEST_URI'</span>]
447:         <span class="ruby-identifier">options</span> = <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">:rewrite_options</span>, <span class="ruby-identifier">parameters</span>)
448:         <span class="ruby-identifier">options</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">:only_path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">action</span>)
449: 
450:         <span class="ruby-identifier">url</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">UrlRewriter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-identifier">parameters</span>)
451:         <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">set_REQUEST_URI</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">rewrite</span>(<span class="ruby-identifier">options</span>))
452:       <span class="ruby-keyword kw">end</span>
453:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000837" class="method-detail">
        <a name="M000837"></a>

        <div class="method-heading">
          <a href="#M000837" class="method-signature">
          <span class="method-name">cookies</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000837-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000837-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 437</span>
437:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cookies</span>
438:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">cookies</span>
439:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000842" class="method-detail">
        <a name="M000842"></a>

        <div class="method-heading">
          <a href="#M000842" class="method-signature">
          <span class="method-name">find_all_tag</span><span class="method-args">(conditions)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000842-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000842-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 464</span>
464:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_all_tag</span>(<span class="ruby-identifier">conditions</span>)
465:       <span class="ruby-identifier">html_document</span>.<span class="ruby-identifier">find_all</span>(<span class="ruby-identifier">conditions</span>)
466:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000841" class="method-detail">
        <a name="M000841"></a>

        <div class="method-heading">
          <a href="#M000841" class="method-signature">
          <span class="method-name">find_tag</span><span class="method-args">(conditions)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000841-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000841-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 460</span>
460:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_tag</span>(<span class="ruby-identifier">conditions</span>)
461:       <span class="ruby-identifier">html_document</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">conditions</span>)
462:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000844" class="method-detail">
        <a name="M000844"></a>

        <div class="method-heading">
          <a href="#M000844" class="method-signature">
          <span class="method-name">fixture_file_upload</span><span class="method-args">(path, mime_type = nil, binary = false)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Shortcut for <tt><a
href="TestUploadedFile.html#M001085">ActionController::TestUploadedFile.new</a>(Test::Unit::TestCase.fixture_path
+ path, type)</tt>:
</p>
<pre>
  post :change_avatar, :avatar =&gt; fixture_file_upload('/files/spongebob.png', 'image/png')
</pre>
<p>
To upload binary files on Windows, pass <tt>:binary</tt> as the last
parameter. This will not affect other platforms:
</p>
<pre>
  post :change_avatar, :avatar =&gt; fixture_file_upload('/files/spongebob.png', 'image/png', :binary)
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000844-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000844-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 484</span>
484:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fixture_file_upload</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">mime_type</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">binary</span> = <span class="ruby-keyword kw">false</span>)
485:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">TestUploadedFile</span>.<span class="ruby-identifier">new</span>(
486:         <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">TestCase</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:fixture_path</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">TestCase</span>.<span class="ruby-identifier">fixture_path</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">path</span>,
487:         <span class="ruby-identifier">mime_type</span>,
488:         <span class="ruby-identifier">binary</span>
489:       )
490:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000836" class="method-detail">
        <a name="M000836"></a>

        <div class="method-heading">
          <a href="#M000836" class="method-signature">
          <span class="method-name">flash</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000836-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000836-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 433</span>
433:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flash</span>
434:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">flash</span>
435:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000840" class="method-detail">
        <a name="M000840"></a>

        <div class="method-heading">
          <a href="#M000840" class="method-signature">
          <span class="method-name">html_document</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000840-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000840-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 455</span>
455:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">html_document</span>
456:       <span class="ruby-identifier">xml</span> = <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">content_type</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/xml$/</span>
457:       <span class="ruby-ivar">@html_document</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">HTML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@response</span>.<span class="ruby-identifier">body</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">xml</span>)
458:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000843" class="method-detail">
        <a name="M000843"></a>

        <div class="method-heading">
          <a href="#M000843" class="method-signature">
          <span class="method-name">method_missing</span><span class="method-args">(selector, *args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000843-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000843-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 468</span>
468:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
469:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>.<span class="ruby-identifier">named_routes</span>.<span class="ruby-identifier">helpers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">selector</span>)
470:         <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
471:       <span class="ruby-keyword kw">else</span>
472:         <span class="ruby-keyword kw">super</span>
473:       <span class="ruby-keyword kw">end</span>
474:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000831" class="method-detail">
        <a name="M000831"></a>

        <div class="method-heading">
          <a href="#M000831" class="method-signature">
          <span class="method-name">process</span><span class="method-args">(action, parameters = nil, session = nil, flash = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
execute the request and set/volley the response
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000831-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000831-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 385</span>
385:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">session</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">flash</span> = <span class="ruby-keyword kw">nil</span>)
386:       <span class="ruby-comment cmt"># Sanity check for required instance variables so we can give an</span>
387:       <span class="ruby-comment cmt"># understandable error message.</span>
388:       <span class="ruby-node">%w(@controller @request @response)</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">iv_name</span><span class="ruby-operator">|</span>
389:         <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">instance_variable_names</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">iv_name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">instance_variable_names</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">iv_name</span>.<span class="ruby-identifier">to_sym</span>)) <span class="ruby-operator">||</span> <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">iv_name</span>).<span class="ruby-identifier">nil?</span>
390:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;#{iv_name} is nil: make sure you set it in your test's setup method.&quot;</span>
391:         <span class="ruby-keyword kw">end</span>
392:       <span class="ruby-keyword kw">end</span>
393: 
394:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">recycle!</span>
395:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">recycle!</span>
396: 
397:       <span class="ruby-ivar">@html_document</span> = <span class="ruby-keyword kw">nil</span>
398:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'REQUEST_METHOD'</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;GET&quot;</span>
399: 
400:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>
401: 
402:       <span class="ruby-identifier">parameters</span> <span class="ruby-operator">||=</span> {}
403:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">assign_parameters</span>(<span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">controller_path</span>, <span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">parameters</span>)
404: 
405:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">session</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">TestSession</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">session</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">session</span>.<span class="ruby-identifier">nil?</span>
406:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">session</span>[<span class="ruby-value str">&quot;flash&quot;</span>] = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Flash</span><span class="ruby-operator">::</span><span class="ruby-constant">FlashHash</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">flash</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flash</span>
407:       <span class="ruby-identifier">build_request_uri</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span>)
408:       <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">process</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-ivar">@response</span>)
409:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000838" class="method-detail">
        <a name="M000838"></a>

        <div class="method-heading">
          <a href="#M000838" class="method-signature">
          <span class="method-name">redirect_to_url</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000838-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000838-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 441</span>
441:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect_to_url</span>
442:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">redirect_url</span>
443:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000835" class="method-detail">
        <a name="M000835"></a>

        <div class="method-heading">
          <a href="#M000835" class="method-signature">
          <span class="method-name">session</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000835-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000835-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 429</span>
429:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">session</span>
430:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">session</span>
431:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000845" class="method-detail">
        <a name="M000845"></a>

        <div class="method-heading">
          <a href="#M000845" class="method-signature">
          <span class="method-name">with_routing</span><span class="method-args">() {|temporary_routes| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
A helper to make it easier to test different route configurations. This
method temporarily replaces ActionController::Routing::Routes with a new
RouteSet instance.
</p>
<p>
The new instance is yielded to the passed block. Typically the block will
create some routes using <tt>map.draw { map.connect &#8230; }</tt>:
</p>
<pre>
  with_routing do |set|
    set.draw do |map|
      map.connect ':controller/:action/:id'
        assert_equal(
          ['/content/10/show', {}],
          map.generate(:controller =&gt; 'content', :id =&gt; 10, :action =&gt; 'show')
      end
    end
  end
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000845-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000845-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 509</span>
509:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_routing</span>
510:       <span class="ruby-identifier">real_routes</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>
511:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">remove_const</span> <span class="ruby-identifier">:Routes</span> }
512: 
513:       <span class="ruby-identifier">temporary_routes</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">RouteSet</span>.<span class="ruby-identifier">new</span>
514:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">const_set</span> <span class="ruby-identifier">:Routes</span>, <span class="ruby-identifier">temporary_routes</span> }
515: 
516:       <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">temporary_routes</span>
517:     <span class="ruby-keyword kw">ensure</span>
518:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">const_defined?</span> <span class="ruby-identifier">:Routes</span>
519:         <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">remove_const</span> <span class="ruby-identifier">:Routes</span> }
520:       <span class="ruby-keyword kw">end</span>
521:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-identifier">:Routes</span>, <span class="ruby-identifier">real_routes</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">real_routes</span>
522:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000833" class="method-detail">
        <a name="M000833"></a>

        <div class="method-heading">
          <span class="method-name">xhr</span><span class="method-args">(request_method, action, parameters = nil, session = nil, flash = nil)</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="TestProcess.html#M000832">xml_http_request</a>
</p>
        </div>
      </div>

      <div id="method-M000832" class="method-detail">
        <a name="M000832"></a>

        <div class="method-heading">
          <a href="#M000832" class="method-signature">
          <span class="method-name">xml_http_request</span><span class="method-args">(request_method, action, parameters = nil, session = nil, flash = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000832-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000832-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 411</span>
411:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">xml_http_request</span>(<span class="ruby-identifier">request_method</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">session</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">flash</span> = <span class="ruby-keyword kw">nil</span>)
412:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_X_REQUESTED_WITH'</span>] = <span class="ruby-value str">'XMLHttpRequest'</span>
413:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_ACCEPT'</span>] = <span class="ruby-value str">'text/javascript, text/html, application/xml, text/xml, */*'</span>
414:       <span class="ruby-identifier">returning</span> <span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">request_method</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">session</span>, <span class="ruby-identifier">flash</span>) <span class="ruby-keyword kw">do</span>
415:         <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">'HTTP_X_REQUESTED_WITH'</span>
416:         <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">'HTTP_ACCEPT'</span>
417:       <span class="ruby-keyword kw">end</span>
418:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>